package StringTest;

        /*需求：键盘录入一个字符串，使用程序实现在控制台遍历该字符串
        *
        *
        * 通过 public char charAt​(int index) 获取字符串的每个字符*/

import java.util.Scanner;

public class case02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String str = scanner.next();
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            System.out.print(c+" ");
        }
    }
}
